import request from "@/utils/request";
import { id } from "element-plus/es/locales.mjs";

// 获取矿区树形结构信息
export function getmineTree(data) {
  return request({
    url: `/safety/openPit/areaTree`,
    method: "post",
    params: data,
  });
}

/**
 * 获取区域下所有的煤矿信息，包含子级
 * @param {*} params
 * @returns
 */
export function getMineByAreaId(areaId) {
  const params = {
    areaId,
    recursion: true,
  };
  return request({
    url: `/safety/openPit/openPit4Tree`,
    method: "post",
    params,
  });
}

/**
 * 获取区划范围，支持批量
 * @param {*} params
 * @returns
 */
export function getDistrictPolygon(params) {
  return request({
    url: `/safety/geometry/getGeometry`,
    method: "get",
    params,
  });
}

/**
 * 获取煤矿信息
 * @param {*} id
 * @returns
 */
export function getOpenpitInfoById(id) {
  return request({
    url: `/safety/openPit/${id}`,
    method: "get",
  });
}

// 获取三维模型
export function getMineLayers(data) {
  return request({
    url: `/safety/layer/find3dtilesDomByOptId`,
    method: "post",
    params: data,
  });
}


